package com.lbn.jfqsc.app.message.adapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.lbn.baseframe.base.BaseRecyclerAdapter;
import com.lbn.baseframe.base.RecyclerViewHolder;
import com.lbn.baseframe.image.LoaderImage;
import com.lbn.baseframe.utils.DateUtils;
import com.lbn.jfqsc.R;
import com.lbn.jfqsc.business.bean.ActivityList;

import java.util.List;

import butterknife.BindView;
import de.hdodenhof.circleimageview.CircleImageView;

/**
 * @author 李炳南
 * @date 2017/3/3
 */
public class PfmAdapter extends BaseRecyclerAdapter<ActivityList> {


    public PfmAdapter(Context ctx, List<ActivityList> list) {
        super(ctx, list);
    }

    @Override
    public int getItemLayoutId(int viewType) {
        return R.layout.layout_item_pfm;
    }

    @Override
    public void bindData(RecyclerViewHolder holder, int position, ActivityList item) {
        ImageView userPhoto = holder.getView(R.id.user_photo);
        TextView userName = holder.getView(R.id.user_name);
        TextView content = holder.getView(R.id.content);
        TextView time = holder.getView(R.id.time);

        LoaderImage.displayImage(item.getCommunityLogo(),userPhoto);
        userName.setText(item.getCommunityName());
        content.setText(item.getActContent());
        time.setText(DateUtils.stampToDate(item.getPublishDate()));
    }
}
